package stark.app.alicloud;

/**
 * <pre>
 *     author : cfans
 *     time   : 2020/11/20
 *     desc   :
 *     version: 1.0
 * </pre>
 */
public class AliPhoneLocBean {

    public int showapi_res_code;
    public String showapi_res_error;
    public String phoneNumber;
    public SubResult showapi_res_body;

    public String getNum(){
        if (phoneNumber != null ){
            return phoneNumber;
        }else {
            return "";
        }
    }

    public String getName(){
        if (showapi_res_body != null && showapi_res_body.name !=null){
            return showapi_res_body.name;
        }else {
            return "";
        }
    }
    public String getArea(){
        if (showapi_res_body != null && showapi_res_body.prov !=null){
            return showapi_res_body.prov + " "+ showapi_res_body.city;
        }else {
            return "";
        }
    }
    public String getAreaCode(){
        if (showapi_res_body != null && showapi_res_body.areaCode !=null){
            return showapi_res_body.areaCode ;
        }else {
            return "";
        }
    }

    public String getPostCode(){
        if (showapi_res_body != null && showapi_res_body.postCode !=null){
            return showapi_res_body.postCode ;
        }else {
            return "";
        }
    }


    static class SubResult{
        String num;
        String prov;
        int ret_code;
        String areaCode;
        String name;
        String cityCode;
        String postCode;
        String provCode;
        int type;
        String city;

        @Override
        public String toString() {
            return "SubResult{" +
                    "num='" + num + '\'' +
                    ", prov='" + prov + '\'' +
                    ", ret_code=" + ret_code +
                    ", areaCode='" + areaCode + '\'' +
                    ", name='" + name + '\'' +
                    ", cityCode='" + cityCode + '\'' +
                    ", postCode='" + postCode + '\'' +
                    ", provCode='" + provCode + '\'' +
                    ", type=" + type +
                    ", city='" + city + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "QueryResult{" +
                "showapi_res_code=" + showapi_res_code +
                ", showapi_res_error='" + showapi_res_error + '\'' +
                ", showapi_res_body=" + showapi_res_body +
                '}';
    }
}
